cmake_minimum_required(VERSION 3.10)
project(CDemo LANGUAGES C)

# 设置C标准（C99）
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)

# 定义源文件
set(SRCS src/main.c src/math.c)

# 创建可执行文件
add_executable(c_demo ${SRCS})

# 添加头文件路径
target_include_directories(c_demo PRIVATE include)

# 添加编译选项
target_compile_options(c_demo PRIVATE -Wall -Wextra)

# 链接数学库
target_link_libraries(c_demo PRIVATE m)